perm filename DZ.PAL[11,HE]1 blob
sn#738207 filedate 1984-01-06 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 Program to talk to TTY via DZ11 with the VT05
C00006 ENDMK
C⊗;
;Program to talk to TTY via DZ11 with the VT05
.INSRT STUFF.PAL[11,ARG]
;DZ11 definitions
DZCSR = 160000 ;Control and Status register
DZLPR = 160002 ;Line Parameter register (write only)
DZRBUF = 160002 ;Receiver Buffer register (read only)
DZTCR = 160004 ;Transmitter Control register (byte)
DZTBUF = 160006 ;Transmitter Buffer (byte, write only)
.=1000
START: RESET
MOV #START,SP ;Set up the stack
MOV #BEGMES,R1 ;Tell world who we are
JSR PC,OUTSTR
MOV #CRLF,R1
JSR PC,OUTSTR
;Set up the DZ11 for line LINE
LP: MOV #17030,R0 ;line parameters: 9600 baud, 8 char, no parity
ADD LINE,R0
MOV R0,DZLPR
MOV #1,R0
ASH LINE,R0
MOVB R0,DZTCR ;Turn on transmit for line
BIS #40,DZCSR ;Turn on master scan enable
;Now talk
TLOOP: JSR PC,INCHR ;Any input - returned in R0
TST R0
BEQ 2$ ; No - go check if anything to print
CMP #26,R0 ;Was it a ↑V? (Do we really want this?)
BNE 1$ ; No
BPT ; Yes - break to DDT
BR 2$ ; Proceeding will just continue
1$: TST DZCSR ;Can we send it yet?
BPL 1$ ; No - wait til we can (This may not work)
MOVB R0,DZTBUF ;Send input char over
2$: MOV DZRBUF,R0 ;See if anything to output
BPL TLOOP ; No
JSR PC,OUTCHR ; Yes - print it
BR TLOOP ;Do it all again
;VT05 I/O routines
OUTSTR: MOVB (R1)+,R0 ;Get next char
BEQ 1$ ;If done -*quit
JSR PC,OUTCHR ;Print it
BR OUTSTR
1$: JSR PC,OUTCHR ;Print a couple nulls
JSR PC,OUTCHR
; JMP OUTCHR
OUTCHR: TST OUTSW ;Who does it go to?
BEQ 2$
1$: TSTB KBOS ;VT05 ready?
BPL 1$ ;Loop til it is
MOVB R0,KBOR ;Print the char
RTS PC
2$: TSTB OREG ;Console ready?
BNE 2$ ;Wait til it is
MOVB R0,OREG ;Output char
RTS PC
INCHR: TST OUTSW ;Where does it come from?
BEQ 1$
TSTB KBIS ;Anything typed on VT05?
BPL 2$ ; No
MOVB KBIR,R0 ; Read the char
BICB #200,R0 ; (Flush parity bit)
RTS PC
1$: TSTB IREG ;Anything from the 10?
BEQ 2$ ; No
MOVB IREG,R0 ; Fetch the char
CLRB IREG
RTS PC
2$: CLR R0 ;No input
RTS PC
;Data & Constants
LINE: .WORD 1 ;Which DZ11 line we are using
BEGMES: .ASCII /πDZ11 terminal test program/
CRLF: .BYTE 12,15,0
.END START